{template '_header'}

<div class="page-header">当前位置：<span class="text-primary">交易设置</span></div>

<div class="page-content">
    <form action="" method="post" class="form-horizontal form-validate" enctype="multipart/form-data" >
        <div class='form-group-title'>线下核销设置</div>
        <div class="form-group">
            <label class="col-lg control-label">是否填写联系人</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'creditshop.set.edit'}
                <label class='radio radio-inline'>
                    <input type='radio' value='0' name='data[set_realname]'  {if $data['set_realname']==0}checked{/if} /> 显示
                </label>
                <label class='radio radio-inline'>
                    <input type='radio' value='1' name='data[set_realname]' {if $data['set_realname']==1}checked{/if} /> 隐藏
                </label>
                {else}
                <div class='form-control-static'>{if $data['set_realname']==1}隐藏{else}显示{/if}</div>
                {/if}
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label">是否填写联系方式</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'creditshop.set.edit'}
                <label class='radio radio-inline'>
                    <input type='radio' value='0' name='data[set_mobile]'  {if $data['set_mobile']==0}checked{/if} /> 显示
                </label>
                <label class='radio radio-inline'>
                    <input type='radio' value='1' name='data[set_mobile]' {if $data['set_mobile']==1}checked{/if} /> 隐藏
                </label>
                {else}
                <div class='form-control-static'>{if $data['set_mobile']==1}隐藏{else}显示{/if}</div>
                {/if}
            </div>
        </div>

        <div class='form-group-title'>自动关闭未付款订单</div>

        <div class="form-group">
            <label class="col-lg control-label">下单几天后</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'sysset.trade.edit'}
                <div class="input-group fixsingle-input-group">
                    <input type="text" name="data[closeorder]" class="form-control" value="{$data['closeorder']}" />
                    <div class="input-group-addon">天</div>
                </div>
                <span class='help-block'>订单下单未付款，n天后自动关闭，空为不自动关闭</span>
                {else}
                <input type="hidden" name="data[closeorder]" value="{$data['closeorder']}"/>
                <div class='form-control-static'>
                    {if empty($data['closeorder'])}9{else}{$data['closeorder']}{/if} 天
                </div>
                {/if}
            </div>
        </div>

        <div class='form-group-title'>未付款订单关闭前发送推送信息</div>

        <div class="form-group ">
            <label class="col-lg control-label">订单关闭前</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'sysset.trade.edit'}
                <div class="input-group fixsingle-input-group">
                    <input type="text" name="data[willcloseorder]" class="form-control" value="{$data['willcloseorder']}" />
                    <div class="input-group-addon">分钟</div>
                </div>
                <span class='help-block'>订单下单未付款自动关闭前多少分钟发送推送消息，0或空为默认30分钟。需要前往消息提醒设置中开启对应推送模块</span>
                {else}
                <input type="hidden" name="data[willcloseorder]" value="{$data['willcloseorder']}"/>
                <div class='form-control-static'>
                    {if empty($data['willcloseorder'])}30{else}{$data['willcloseorder']}{/if} 分钟
                </div>
                {/if}
            </div>
        </div>

        <div class='form-group-title'>库存预警推送通知</div>

        <div class="form-group">
            <label class="col-lg control-label">库存少于</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'sysset.trade.edit'}
                <div class="input-group">
                    <input type="text" name="data[stockwarn]" class="form-control" value="{$data['stockwarn']}" />
                    <div class="input-group-addon">件</div>
                </div>
                <span class='help-block'>库存低于多少件后,每当减少库存时会为卖家推送一次库存警报,默认为5件</span>
                {else}
                <input type="hidden" name="data[stockwarn]" value="{$data['stockwarn']}"/>
                <div class='form-control-static'>
                    {if empty($data['stockwarn'])}5{else}{$data['stockwarn']}{/if} 天
                </div>
                {/if}
            </div>
        </div>


        <div class='form-group-title'>自动收货</div>


        <div class="form-group">
            <label class="col-lg control-label">发货几天后</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'sysset.trade.edit'}
                <div class="input-group fixsingle-input-group">
                    <input type="text" name="data[receive]" class="form-control" value="{$data['receive']}" />
                    <div class="input-group-addon">天</div>
                </div>
                <span class='help-block'>订单发货后，用户收货的天数，如果在期间未确认收货，系统自动完成收货，空为不自动收货</span>
                {else}
                <input type="hidden" name="data[receive]" value="{$data['receive']}"/>
                <div class='form-control-static'>
                    {if empty($data['receive'])}9{else}{$data['receive']}{/if} 天
                </div>
                {/if}
            </div>
        </div>
        <div class='form-group-title'>退款申请</div>


        <div class="form-group">
            <label class="col-lg control-label">完成订单几天后</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'sysset.trade.edit'}
                <div class="input-group fixsingle-input-group">
                    <input type="text" name="data[refunddays]" class="form-control" value="{$data['refunddays']}" />
                    <div class="input-group-addon">天</div>
                </div>
                <span class='help-block'>订单完成后 ，用户在x天内可以发起退款申请，设置0天不允许完成订单退款</span>
                {else}
                <input type="hidden" name="data[refunddays]" value="{$data['refunddays']}"/>
                <div class='form-control-static'>
                    {if empty($data['refunddays'])}不允许完成订单退款{else}{$data['refunddays']}{/if} 天
                </div>
                {/if}
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label">退款说明</label>
            <div class="col-sm-5 col-xs-12">
                {ifp 'sysset.trade.edit'}
                <textarea  name="data[refundcontent]" class="form-control" value="{$data['refundcontent']}" rows="5">{$data['refundcontent']}</textarea>
                <span class='help-block'>用户在申请退款页面的说明</span>
                {else}
                <input type="hidden" name="data[refundcontent]" value="{$data['refundcontent']}"/>
                <div class='form-control-static'>
                    {$data['refundcontent']}
                </div>
                {/if}
            </div>
        </div>
        <div class='form-group-title'>余额积分设置</div>

        <div class="form-group">
            <label class="col-lg control-label">文字</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'sysset.trade.edit'}
                <div class='input-group fixmore-input-group'>
                    <span class='input-group-addon'>积分=</span>
                    <input type="text" name="data[credittext]" class="form-control" value="{php echo empty($data['credittext'])?'积分':$data['credittext']}" />
                    <span class='input-group-addon'>余额=</span>
                    <input type="text" name="data[moneytext]" class="form-control"value="{php echo empty($data['moneytext'])?'余额':$data['moneytext']}" />
                </div>
                {else}

                <div class='form-control-static'>
                    积分文字:  {php echo empty($data['credittext'])?'积分':$data['credittext']} 余额文字: {php echo empty($data['moneytext'])?'余额':$data['moneytext']}

                </div>
                {/if}
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">账户充值</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'sysset.trade.edit'}
                <label class='radio-inline'><input type='radio' name='data[closerecharge]' value='0' {if empty($data['closerecharge'])}checked{/if} onclick="$('.recharge-group').show()"/> 开启</label>
                <label class='radio-inline'><input type='radio' name='data[closerecharge]' value='1' {if $data['closerecharge']=='1'}checked{/if}  onclick="$('.recharge-group').hide()"/> 关闭</label>
                <span class='help-block'>是否允许用户对账户余额进行充值</span>
                {else}
                <input type="hidden" name="data[withdraw]" value="{$data['withdraw']}"/>
                <div class='form-control-static'>{if $data['closerechage']==1}关闭{else}开启{/if}</div>
                {/if}
            </div>
        </div>

        <div class="form-group recharge-group" {if $data['closerecharge']=='1'}style="display:none;"{/if}>
        <label class="col-lg control-label"></label>
        <div class="col-sm-9 col-xs-12">
            {ifp 'sysset.trade.edit'}
            <div class='input-group fixmore-input-group'>
                <span class='input-group-addon'>充值</span>
                <input type="text" name="data[money]" class="form-control" value="{$data['money']}" />
                <span class='input-group-addon'>元 增加</span>
                <input type="text" name="data[credit]" class="form-control" value="{$data['credit']}" />
                <span class='input-group-addon'>分</span>
            </div>
            <span class='help-block'>用户充值获得的积分,累计形式 比如 充值1元 送1积分,充值200，就送200积分</span>
            {else}
            <input type="hidden" name="data[money]" value="{$data['money']}"/>
            <input type="hidden" name="data[credit]" value="{$data['credit']}"/>
            <div class='form-control-static'>
                {if empty($data['money'])}
                充值无积分
                {else}
                {$data['money']} 元增加 {$data['credit']} 积分
                {/if}
            </div>
            {/if}
        </div>
</div>

<div class="form-group recharge-group" {if $data['closerecharge']=='1'}style="display:none;"{/if}>
<label class="col-lg control-label">最低充值金额</label>
<div class="col-sm-9 col-xs-12">
    {ifp 'sysset.trade.edit'}
    <div class="input-group fixsingle-input-group">
        <input type="text" name="data[minimumcharge]" class="form-control" value="{$data['minimumcharge']}" />
        <div class="input-group-addon">元</div>
    </div>
    <span class='help-block'>账户充值时,最低允许的充值金额</span>
    <span class='help-block'>例如 最低充值金额设置为10元,只有充值金额大于等于10元时,才允许充值</span>
    {else}
    <input type="hidden" name="data[minimumcharge]" value="{$data['minimumcharge']}"/>
    <div class='form-control-static'>
        {$data['minimumcharge']}元
    </div>
    {/if}
</div>
</div>

<div class="form-group">
    <label class="col-lg control-label">余额提现</label>
    <div class="col-sm-9 col-xs-12 ">
        {ifp 'sysset.trade.edit'}
        <label class='radio-inline'><input type='radio' name='data[withdraw]' value='1' {if $data['withdraw']==1}checked{/if}/> 开启</label>
        <label class='radio-inline'><input type='radio' name='data[withdraw]' value='0' {if $data['withdraw']==0}checked{/if} /> 关闭</label>
        <span class='help-block'>是否允许用户将余额提出</span>
        {else}
        <input type="hidden" name="data[withdraw]" value="{$data['withdraw']}"/>
        <div class='form-control-static'>{if $data['withdraw']==1}开启{else}关闭{/if}</div>
        {/if}
    </div>
</div>

<div class="form-group">
    <label class="col-lg control-label">余额提现方式</label>
    <div class="col-sm-9 col-xs-12" >
        {ifp 'sysset.trade.edit'}
        <label for="withdrawcashweixin" class="checkbox-inline">
            <input type="checkbox" name="data[withdrawcashweixin]" value="1" id="withdrawcashweixin" {if !empty($data['withdrawcashweixin'])}checked="true"{/if} /> 提现到微信钱包
        </label>

        <label for="withdrawcashalipay" class="checkbox-inline">
            <input type="checkbox" name="data[withdrawcashalipay]" value="1" id="withdrawcashalipay" {if !empty($data['withdrawcashalipay'])}checked="true"{/if} /> 手动提现到支付宝
        </label>

        <label for="withdrawcashcard" class="checkbox-inline">
            <input type="checkbox" name="data[withdrawcashcard]" value="1" id="withdrawcashcard" {if !empty($data['withdrawcashcard'])}checked="true"{/if} /> 手动提现到银行卡
        </label>

        <div class='help-block'>支持的银行请到<a href='{php echo webUrl('commission/bank')}' target='_blank'>【银行设置】</a>进行设置,使用手动提现到银行卡必须设置支持的银行</div>

        <div class='help-block'>提示: 提现方式支持多选</div>
        {else} <div class='form-control-static'>
        {if $data['withdrawcashweixin']==1}提现到微信钱包; {/if}
        {if $data['withdrawcashalipay']==1}手动提现到支付宝; {/if}
        {if $data['withdrawcashcard']==1}手动提现到银行卡; {/if}
    </div>
        {/if}
    </div>
</div>



<div class="form-group">
    <label class="col-lg control-label">余额提现限制</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'sysset.trade.edit'}
        <input type="text" name="data[withdrawmoney]" class="form-control" value="{$data['withdrawmoney']}" />
        <span class='help-block'>余额满多少才能提现,空或0不限制</span>
        {else}
        <input type="hidden" name="data[withdrawmoney]" value="{$data['withdrawmoney']}"/>
        <div class='form-control-static'>
            {if empty($data['withdrawmoney'])}不限制{else}{$data['withdrawmoney']} 元 {/if}
        </div>
        {/if}
    </div>
</div>

<div class="form-group">
    <label class="col-lg control-label">余额提现手续费</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'sysset.trade.edit'}
        <div class="input-group fixmore-input-group">
            <input type="text" name="data[withdrawcharge]" class="form-control" value="{$data['withdrawcharge']}" />
            <div class="input-group-addon">%</div>
        </div>
        <span class='help-block'>余额提现时,扣除的手续费.空为不扣除手续费</span>
        {else}
        <input type="hidden" name="data[withdrawcharge]" value="{$data['withdrawcharge']}"/>
        <div class='form-control-static'>
            {$data['withdrawcharge']}%
        </div>
        {/if}
    </div>
</div>

<div class="form-group">
    <label class="col-lg control-label">免手续费金额区间</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'sysset.trade.edit'}
        <div class='input-group fixmore-input-group'>
            <span class='input-group-addon'>开始金额￥</span>
            <input type="text" name="data[withdrawbegin]" class="form-control" value="{$data['withdrawbegin']}" />
            <span class='input-group-addon'>结束金额￥</span>
            <input type="text" name="data[withdrawend]" class="form-control" value="{$data['withdrawend']}" />
        </div>
        <span class='help-block'>当手续费金额在此区间内时,不扣除手续费. 结束金额 必须大于 开始金额才能生效</span>
        <span class='help-block'>例如 设置开始金额0元 结束金额5元,只有手续费金额高于5元时,才扣除</span>
        {else}
        <input type="hidden" name="data[withdrawbegin]" value="{$data['withdrawbegin']}"/>
        <input type="hidden" name="data[withdrawend]" value="{$data['withdrawend']}"/>
        <div class='form-control-static'>
            {$data['withdrawbegin']} 元 - {$data['withdrawend']}元
        </div>
        {/if}
    </div>
</div>

<div class="form-group recharge-group">
    <label class="col-lg control-label">会员积分上限</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'sysset.trade.edit'}
        <div class="input-group fixsingle-input-group">
            <input type="number" name="data[maxcredit]" class="form-control" value="{php echo intval($data['maxcredit'])}" />
            <div class="input-group-addon">积分</div>
        </div>
        <span class='help-block text-danger'>会员最高积分，0为不限制(会员积分大于等于此值时将无法继续增加，后台手动充值不限制，已持有积分不限制)</span>
        {else}
        <input type="hidden" name="data[maxcredit]" value="{$data['maxcredit']}"/>
        <div class='form-control-static'>
            {$data['maxcredit']}积分
        </div>
        {/if}
    </div>
</div>

<div class='form-group-title'>评价</div>

<div class="form-group">
    <label class="col-lg control-label">订单评价</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'sysset.trade.edit'}
        <label class='radio-inline'><input type='radio' name='data[closecomment]' value='0' {if empty($data['closecomment'])}checked{/if} /> 允许</label>
        <label class='radio-inline'><input type='radio' name='data[closecomment]' value='1' {if $data['closecomment']=='1'}checked{/if}  /> 不允许</label>
        <span class='help-block'>是否允许用户对订单进行评价</span>
        {else}
        <input type="hidden" name="data[closecomment]" value="{$data['closecomment']}"/>
        <div class='form-control-static'>{if $data['closecomment']==1}不允许{else}允许{/if}</div>
        {/if}
    </div>
</div>

<div class="form-group">
    <label class="col-lg control-label">显示评价 </label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'sysset.trade.edit'}
        <label class='radio-inline'><input type='radio' name='data[closecommentshow]' value='0' {if empty($data['closecommentshow'])}checked{/if}/> 显示</label>
        <label class='radio-inline'><input type='radio' name='data[closecommentshow]' value='1' {if $data['closecommentshow']=='1'}checked{/if} /> 关闭</label>
        <span class='help-block'>是否允许商品详情页面显示评价</span>
        {else}
        <input type="hidden" name="data[closecommentshow]" value="{$data['closecommentshow']}"/>
        <div class='form-control-static'>{if $data['closecommentshow']==1}关闭{else}显示{/if}</div>
        {/if}
    </div>
</div>

<div class="form-group">
    <label class="col-lg control-label">评价免审核 </label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'sysset.trade.edit'}
        <label class='radio-inline'><input type='radio' name='data[commentchecked]' value='1' {if $data['commentchecked']=='1'}checked{/if} /> 是</label>
        <label class='radio-inline'><input type='radio' name='data[commentchecked]' value='0' {if empty($data['commentchecked'])}checked{/if}/> 否</label>
        <span class='help-block'>用户发表的评价是否免审核</span>
        {else}
        <input type="hidden" name="data[commentchecked]" value="{$data['commentchecked']}"/>
        <div class='form-control-static'>{if $data['commentchecked']==1}是{else}否{/if}</div>
        {/if}
    </div>
</div>

<div class='form-group-title'>获取微信共享收货地址</div>



<div class='panel-body'>

    <div class="form-group">
        <label class="col-lg control-label">状态</label>
        <div class="col-sm-9 col-xs-12">
            {ifp 'sysset.trade.edit'}
            <label class='radio-inline'><input type='radio' name='data[shareaddress]' value='1' {if $data['shareaddress']==1}checked{/if}/> 开启</label>
            <label class='radio-inline'><input type='radio' name='data[shareaddress]' value='0' {if $data['shareaddress']==0}checked{/if} /> 关闭</label>
            <span class='help-block'>是否在用户添加收货地址时候获取用户的微信收货地址</span>
            {else}
            <input type="hidden" name="data[shareaddress]" value="{$data['shareaddress']}"/>
            <div class='form-control-static'>{if $data['shareaddress']==1}开启{else}关闭{/if}</div>
            {/if}
        </div>
    </div>
</div>


<div class='form-group-title'>限时购名称</div>



<div class='panel-body'>

    <div class="form-group">
        <label class="col-lg control-label">限时购名称</label>
        <div class="col-sm-9 col-xs-12">
            {ifp 'sysset.trade.edit'}
            <input  name="data[istimetext]" class="form-control"  value="{php echo empty($data['istimetext'])?'限时购':$data['istimetext']}" />
            <span class='help-block'>商品详情页面限时购名称前缀 ,默认为"限时购" ,商品可单独设置</span>
            {else}
            <input type="hidden" name="data[istimetext]" value="{$data['istimetext']}"/>
            <div class='form-control-static'>
                {$data['istimetext']}
            </div>
            {/if}
        </div>
    </div>
</div>


<div class='form-group-title'>商城不配送区域</div>

<div class="form-group">
    <label class="col-lg control-label">不配送区域</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'sysset.trade.edit'}
        <div id="areas" class="form-control-static">{$data[nodispatchareas]}</div>
        <a href="javascript:;" class="btn btn-default" onclick="selectAreas()">选择地区</a>
        <input type="hidden" id='selectedareas' name="data[nodispatchareas]" value="{$data[nodispatchareas]}" />
        <input type="hidden" id='selectedareas_code' name="data[nodispatchareas_code]" value="{$data[nodispatchareas_code]}" />
        {else}
        <div class='form-control-static'>{$data[nodispatchareas]}</div>
        {/if}
    </div>
</div>



<div class="form-group">
    <label class="col-lg control-label"></label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'sysset.trade.edit'}
        <input type="submit" value="提交" class="btn btn-primary"  />
        {/if}
    </div>
</div>


</form>
</div>

{if empty($new_area)}
{template 'shop/selectareas'}
{else}
{template 'shop/selectareasNew'}
{/if}

{template '_footer'}     